package ${c.module.totalPackage}.${c.module.moduleName}.dao;

<#if c.hasManyToOne>
import java.util.List;
</#if>
import com.guinea.core.orm.HibernateDao;
import ${c.module.totalPackage}.${c.module.moduleName}.entity.${c.name};

public class ${c.name}Dao extends HibernateDao {

	public Class getEntityClass() {
		return ${c.name}.class;
	}
	<#if c.hasManyToOne>

	public List getBy<#list c.manyToOne as o>${o.className}</#list>(<#list c.manyToOne as o><#if o_index != 0>, </#if>Long ${o.refId}</#list>) {
		return find(
				"select e from ${c.name} e where e.status = '1'<#list c.manyToOne as o> and e.${o.name}.id = ?</#list>",
				new Object[] { <#list c.manyToOne as o><#if o_index != 0>, </#if>${o.refId}</#list> });
	}
	</#if>
	
}
